package com.aispeech.task.api;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.event.ContextClosedEvent;

@SpringBootApplication(
        exclude = {RedisRepositoriesAutoConfiguration.class}
)
@ComponentScan("com.aispeech.task")
@Slf4j
public class APIApp implements ApplicationListener<ContextClosedEvent> {
    public static void main(String[] args) {
        SpringApplication.run(APIApp.class, args);
        log.info("app:api started.");
    }

    @Override
    public void onApplicationEvent(ContextClosedEvent contextClosedEvent) {
        log.info("shutdown...");
    }
}
